<template>
	<scroll-view scroll-x="true" class="navAre">
		<block v-for="(item,index) in navList" :key="index">
			<view class="nav" @click="navClick(index,item.id)">
				<text :class="[current == index?'themeColor': '']">{{item.name}}</text>
				<view :class="[current == index?'line':'']"></view>
			</view>
		</block>
	</scroll-view>
</template>

<script>
	export default {
		props: ['navList','current'],
		data() {
			return {
				
			};
		},
		methods:{
			navClick(index,id){
				if(this.current == index) return
				this.$emit('navChange',index,id)
			},
		}
	}
</script>

<style lang="scss">
	.navAre{
		@include height(80rpx);
		@include backG;
		white-space: nowrap;
		overflow: hidden;
		
	}
	.nav{
		@include widthHeight(15%,80rpx);
		@include text-align;
		@include font;
		@include margin(0 20rpx)
	    display: inline-block;
		position: relative;
		box-sizing: border-box;
		.line{
			@include widthHeight(30rpx,4rpx);
			background: $themeColor;
			position: absolute;
			bottom: 6rpx;
			left: 50%;
			@include margin(-15rpx,'left');
		}
	}
	
</style>
